import React from "react";
import './index.css'
import { Outlet } from "react-router-dom";
import { Layout, Menu, Icon } from 'antd'

class Git extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            data: [
                {
                    title: '初始化本地 Git 存储库',
                    content: 'git init',
                    id: 1,
                },
                {
                    id: 2,
                    title: '克隆公共存储库',
                    content: 'git clone repo_url'
                },
                {
                    id: 3,
                    title: '克隆私有仓库',
                    content: 'git clone git@gitee.com:zhou_shihao/react-app.git'
                },
                {
                    id: 4,
                    title: '将文件添加到暂存区',
                    content: 'git add [file-name]'
                },
                {
                    id: 5,
                    title: '检查状态',
                    content: 'git status'
                },
                {
                    id: 6,
                    title: '将所有新的和更改的文件添加到暂存区',
                    content: 'git add -A'
                },
                {
                    id: 7,
                    title: '提交更改',
                    content: 'git commit -m "[commit message]"'
                },
                {
                    id: 8,
                    title: '删除文件或文件夹',
                    content: 'git rm -r [file-name.text]'
                },
                {
                    id: 9,
                    title: '分支列表（星号表示当前分支）',
                    content: 'git branch'
                },
                {
                    id: 10,
                    title: '创建一个新的分支',
                    content: 'Git branch [branch name]'
                },
                {
                    id: 11,
                    title: '删除远程分支',
                    content: 'git push origin --delete [branch name]'
                },
                {
                    id: 12,
                    title: '删除一个分支',
                    content: 'git branch -d [branch    name]'
                },
                {
                    id: 13,
                    title: '强行删除一个分支',
                    content: 'git branch -D [branch    name]'
                },
                {
                    id: 14,
                    title: '创建一个新分支并切换到他',
                    content: 'git checkout -b [branch name]'
                },
                {
                    id: 15,
                    title: '克隆一个远程分支并且换到它',
                    content: 'git checkout -b [branch name] origin/[branch name] '
                },
                {
                    id: 16,
                    title: '重命名本地分支',
                    content: 'git branch -m [old branch name] [new branch name]'
                },
                {
                    id: 17,
                    title: '切换到分支',
                    content: 'git checkout [branch name]'
                },
                {
                    id: 18,
                    title: '切换到上次签出的分支',
                    content: 'git checkout -'
                },
                {
                    id: 19,
                    title: '放弃对文件的更改（丢弃更改）',
                    content: 'git checkout -- [file-name.text]'
                },
                {
                    id: 20,
                    title: '将分支合并到活动分支中',
                    content: 'git merge [branch name]'
                },
                {
                    id: 21,
                    title: '将一个分支合并到目标分支中',
                    content: 'git merge [source branch] [target branch]'
                },
                {
                    id: 22,
                    title: '将更改储存在脏工作目录中',
                    content: 'git stash'
                },
                {
                    id: 23,
                    title: '删除所有隐藏的题目',
                    content: 'git stash clear'
                },
                {
                    id: 24,
                    title: '将分支推送到您的远程仓库',
                    content: 'git push origin [branch name]'
                },
                {
                    id: 25,
                    title: '将更改推送到远程储存库（并记住分支）',
                    content: 'git push -u origin [branch name]'
                },
                {
                    id: 26,
                    title: '将更改推送到远程储存库（记住的分支）',
                    content: 'git push'
                },
                {
                    id: 27,
                    title: '删除远程分支',
                    content: 'git push origin --delete [branch name]'
                },
                {
                    id: 28,
                    title: '将本地储存库更新最新的提交',
                    content: 'git pull'
                },
                {
                    id: 29,
                    title: '将本地存储库中提取更改',
                    content: 'git pull origin [branch name] '
                },
                {
                    id: 30,
                    title: '将存储库的源分支设置为SSH',
                    content: 'git remote set- url origin ssh://git@github.com/[username]/[repository-name].git'
                },
                {
                    id: 31,
                    title: '添加远程存储库',
                    content: 'git remote add origin ssh://git@github.com/[username]/[repository-name].git'
                },
                {
                    id: 32,
                    title: '查看更改',
                    content: 'git log'
                },
                {
                    id: 33,
                    title: '查看更改（详细）',
                    content: 'git log --summary'
                },
                {
                    id: 34,
                    title: '查看更改（简要）',
                    content: 'git log --oneline'
                },
                {
                    id: 35,
                    title: '合并前预览更改',
                    content: 'git diff [source branch][target branch]'
                },
                {
                    id: 36,
                    title: '恢复提交更改',
                    content: 'git revert commitid'
                },
                {
                    id: 37,
                    title: '获取全局配置',
                    content: 'git config --global --list'
                },
                {
                    id: 38,
                    title: '全局设置用户名',
                    content: 'git config --global user.name "your_username"'
                },
                {
                    id: 39,
                    title: '全局设置电子邮件 ID',
                    content: 'git config --global user.email "your_email_address@example.com"'
                },
            ]
        }
    }
    render () {
        const { data } = this.state
        return (
            <div>
                <ol >
                    {data.map((item, index) => {
                        return (
                            <div key={item.id}>
                                <li className="BiaoTi">{item.title}</li>
                                <p className="p_content" >{item.content}</p>
                            </div>
                        )

                    })}

                </ol>
            </div>
        )
    }
}
export default Git